import Mock from 'mockjs'

/**
 * 分页获取海报列表
 */
export const getPosterPage = async (params: pagination & Poster): Promise<ResPosterList> => {
  const res = await Mock.mock({
    'list|10': [
      {
        'id|+1': 1,
        title: '@cparagraph(1, 3)',
        thumb_url: '@image(200x100, @color, @color, @word)',
        big_url: '@image(800x400, @color, @color, @word)',
        createTime: 1691143890537,
        visible: '@integer(0,1)'
      }
    ],
    pageNo: 1,
    pageSize: 10,
    total: 30
  })
  return res
}

/**
 * 删除海报
 * @param {number} id
 */
export const deletePoster = async (id: number): Promise<ResStatus> => {
  const res = await Mock.mock({
    isSuccess: true
  })
  return res
}

/**
 * 更新海报
 * @param {number} id
 */
export const updatePoster = async (params: Poster): Promise<ResStatus> => {
  const res = await Mock.mock({
    isSuccess: true
  })
  return res
}
